<template>
  <div class="pageBox">
    <head-component title="公告详情"></head-component>
    <div class="content">
      <div class="title">
        <p>{{ details.title }}</p>
        <span>{{ details.time }}</span>
      </div>
      <div class="con" v-html="details.content">
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import { defineComponent, ref } from "vue";
import headComponent from "../../components/headComponent.vue";
import router from "../../router";
import { post } from "../../untils/request";

export default defineComponent({
  components: {
    headComponent,
  },
  setup() {
    const id = ref(router.currentRoute.value.query.id ? router.currentRoute.value.query.id : ""); // 公告id
    const details = ref({});

    function getDetails() {
      post("/portal",{
         module: "Content",
        interface: "3001",
        data: {
          id: id.value
        }
      }).then((res) => {
        details.value = res.data;
      });
    }
    getDetails() 

    return {
      id,
      details,
      getDetails,
    };
  },
});
</script>

<style scoped lang="less">
.pageBox {
  width: 100%;
  min-height: 100vh;
  background: #fff;
  padding-top: 88px;
  .content {
    padding: 0 30px;
    .title {
      padding-top: 44px;
      margin-bottom: 16px;
      p {
        font-size: 36px;
        font-weight: 500;
        color: #333333;
        margin-bottom: 16px;
      }
      span {
        font-size: 26px;
        font-weight: 400;
        color: #999999;
      }
    }
    .con {
      font-size: 28px;
      font-weight: 400;
      color: #333333;
     :deep(img) {
       max-width: 100%;
     }
    }
  }
}
</style>